<template>
	<view class="pageBoxQuan">

		<view class="mainBox">
			<view class="titleBox">
				<view class="title">
					诚邀您加入
				</view>
				<view class="title title1">
					记工本·记工记账·交流群
				</view>
			</view>

			<view class="lineBox">
				<view class="lineMain">

				</view>
			</view>
			<view class="qunBox">
				<image :src="weixunqun" show-menu-by-longpress="true" mode="widthFix" @click="previewImageA"></image>
				<view class="text">
					长按二维码，进入工友交流群
				</view>
			</view>

			<view class="copy">
				工地记工记账，就用记工本
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 用户信息
				userInfo: {},

				// 分享弹窗
				shareShow: false,

				// 生成海报
				poster: {},
				posterPath: '',
				weixunqun: '',
				qunShow: false,
			}
		},
		created() {
			var _this = this;
			//_this.getPosterInfo();

		},
		onLoad() {},
		onShow() {
			var _this = this;

			_this.getQun();
		},
		onReady() {
			// 设置消息提醒
			// uni.setTabBarBadge({
			// 	index: 1,
			// 	text: '1'
			// })
		},
		onHide() {
			this.shareShow = false;
		},
		onShareAppMessage(res) {
			return {
				title: '记工小程序',
				path: '/pages/index/index',
				imageUrl: '/static/sharePic.jpg',
			}
		},
		onShareTimeline(res) {
			return {
				title: '记工小程序',
				path: '/pages/index/index',
				imageUrl: '/static/sharePic.jpg',
			}
		},
		methods: {


			previewImageA(e) {
				console.log('e', e);
				
				// #ifdef APP-PLUS
				var urls=[];
				urls[0]=this.weixunqun
				uni.previewImage({
					// 需要预览的图片链接列表
					urls: urls,
					// 为当前显示图片的链接/索引值
					current: this.weixunqun,
					
					success: res => {
						console.log('res', res);
					},
					fail: err => {
						console.log('err', err);
					}
				})
				// #endif
				
				// #ifdef MP-WEIXIN
				uni.previewImage({
					// 需要预览的图片链接列表
					urls: [],
					// 为当前显示图片的链接/索引值
					current: this.weixunqun,
					// 图片指示器样式	
					indicator: 'default',
					// 是否可循环预览
					loop: false,
					longPressActions: {
						itemList: ['发送给朋友', '保存图片', '收藏'],
					},
					success: res => {
						console.log('res', res);
					},
					fail: err => {
						console.log('err', err);
					}
				})
				// #endif
				
			},



			// 获取数据辞典信息
			getQun() {
				let _this = this;
				_this.$u.get('/api/plus.dictionaries/getDetail', {
					name: 'weixinqun',
				}).then(res => {
					console.log("==获取数据辞典信息==");
					console.log(res);
					var weixunqun = res.data.value;

					_this.weixunqun = weixunqun;

				}).catch(res => {
					console.log(res);
				})
			},
			tishiShare() {
				uni.showModal({
					title: "提示",
					content: '安卓系统请点击右上角“...”选择分享朋友圈，ios暂不支持',
					showCancel: false
				})
				this.shareShow = false;
			},
			// 获取用户信息



		}
	}
</script>
<style scoped lang="scss">
	.pageBoxQuan {
		width: 100%;
		height: 100vh;
		background-color: #F5F6F8;
	}

	.pageBg {
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		z-index: 99;
	}

	.pageBg image {
		width: 100%;
		height: 100%;
	}

	.mainBox {
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		z-index: 999;
	}

	.lineBox {
		width: 550rpx;
		height: 20rpx;
		background-color: #F5F6F8-blod;
		padding: 6rpx 20rpx;
		margin: 30rpx auto 0 auto;
		border-radius: 20rpx;
	}

	.lineMain {
		width: 100%;
		height: 10rpx;
		background-color: #AFB0B3;
		border-radius: 20rpx;
	}

	.qunBox {
		width: 500rpx;
		height: 550rpx;
		background-color: #fff;
		margin: 0 auto;
		padding: 20rpx;
		text-align: center;
		margin-top: -10rpx;
	}

	.qunBox image {
		width: 400rpx;
		height: 400rpx;
		margin-top: 30rpx;
	}

	.qunBox .text {
		text-align: center;
		line-height: 80rpx;
		color: #666;
	}

	.titleBox {
		padding-top: 20%;
	}

	.title {
		font-size: 40rpx;
		font-weight: bold;
		color: $uni-color;
		text-align: center;
		padding-top: 30rpx;
	}

	.title1 {
		font-weight: 400;
		color: $uni-color-text;
		font-size: 34rpx;
	}

	.copy {
		position: fixed;
		bottom: 30rpx;
		left: 0;
		z-index: 9999;
		width: 100%;
		text-align: center;
		height: 80rpx;
		line-height: 80rpx;
		color: #999;
	}
</style>
